import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class JdbcDemo03 {
    public static void main(String[] args) throws SQLException {
        Statement statement = JDBCUtil.getStatement();
        String sql = "select * from student";
        ResultSet resultSet = statement.executeQuery(sql);
        while (resultSet.next()) {
            String name = resultSet.getString(2);
            System.out.println(name);
        }
        JDBCUtil.close(resultSet);
    }
}
